*** REPLICATION TOOLKIT ***

* AUTHORS: CIMINELLI DUVAL FURCERI 

* ARTICLE: EMPLOYMENT PROTECTION DEREGULATION AND LABOR SHARES IN ADVANCED ECONOMIES 

* JOURNAL: REVIEW OF ECONOMICS AND STATISTICS

* OUTPUT: FIGURE 2, PANEL B

***************************

cd ""

global horizon 6 
global ci = 1.6

use "DTA files/Dataset country", clear

************* CLEAN DATASET ******************

xtset ifscode year

************ PREPARE VARIABLES **********

***labor shares**
gen f1l=100*(ls_agg-l.ls_agg)
gen f2l=100*(f.ls_agg-l.ls_agg)
gen f3l=100*(f2.ls_agg-l.ls_agg)
gen f4l=100*(f3.ls_agg-l.ls_agg)
gen f5l=100*(f4.ls_agg-l.ls_agg)
gen f6l=100*(f5.ls_agg-l.ls_agg)

* Crisis dummy
gen lny=ln(gdpv)
gen f1=lny-l.lny
gen gcrisis=0
replace gcrisis=1 if f1<-0.03

*********************Figure 2 Panel A and B***************

* Global for forward variables (Teulings and Zubanov)
global f1
global f2 f1.EPLregularworkers
global f3 f1.EPLregularworkers f2.EPLregularworkers
global f4 f1.EPLregularworkers f2.EPLregularworkers f3.EPLregularworkers
global f5 f1.EPLregularworkers f2.EPLregularworkers f3.EPLregularworkers f4.EPLregularworkers
global f6 f1.EPLregularworkers f2.EPLregularworkers f3.EPLregularworkers f4.EPLregularworkers f5.EPLregularworkers

************ ANALYSIS AND GRAPH - STRIKES **********

matrix baseline = J($horizon,4,.)

forvalues i= 1/$horizon {
xtscc  f`i'l EPLregularworkers i.year l(0/4)gcrisis l(1/4)EPLregularworkers l(1/4)EPLtemp l(1/4).f1l ${f`i'}, fe lag(2)
matrix results = r(table)
matrix baseline[`i',1] = results[1,1]
matrix baseline[`i',2] = results[2,1]
matrix baseline[`i',3] = results[1,1] + $ci*results[2,1]
matrix baseline[`i',4] = results[1,1] - $ci*results[2,1]
}
capture drop coeff2 ci_p2 ci_n2
matrix coeff2 = baseline[1...,"c1"]
matrix ci_p2 = baseline[1...,"c3"]
matrix ci_n2 = baseline[1...,"c4"]
svmat coeff2
svmat ci_p2
svmat ci_n2
capture drop horizon
egen horizon = group(year) 
replace horizon = . if coeff21==.

* Create graph
graph set window fontface "Times New Roman"
graph twoway line coeff2 ci_p2 ci_n2 horizon, graphregion(color(white)) ytitle("") xtitle("") yline(0, lcolor(black)) xlab(1 "0"2 "1"3 "2"4 "3"5 "4"6 "5") legend(off) lpattern(solid shortdash shortdash) lwidth (thick thick thick) lcolor(blue red red) ytitle("% change", height(5)) subtitle("{bf:Panel C.} Labor share") ysize(10) xsize(15)
graph copy C, replace
